package com.xuecheng.content.convert;


import com.xuecheng.api.media.model.CourseTeacherDTO;
import com.xuecheng.content.entity.CourseTeacher;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 教师和课程关联的数据转换类
 */
@Mapper
public interface CourseTeacherConvert {
    
    CourseTeacherConvert INSTANCE = Mappers.getMapper(CourseTeacherConvert.class);

    @Mapping(source = "id", target = "courseTeacherId")
    CourseTeacherDTO entity2dto(CourseTeacher entity);

    @Mapping(source = "courseTeacherId", target = "id")
    CourseTeacher dto2entity(CourseTeacherDTO dto);

    List<CourseTeacherDTO> entitys2dtos(List<CourseTeacher> entitys);
}
